from nicegui import ui, app


class LayoutView:
    def __init__(self) -> None:
        with ui.header(elevated=True).style("background-color: #3874c8").classes(
            "items-center justify-between"
        ):
            ui.label("HEADER")
            ui.button(on_click=lambda: right_drawer.toggle(), icon="menu").props(
                "flat color=white"
            )
            # 换行
            ui.html("<br>")
        with ui.left_drawer(top_corner=True, bottom_corner=True).style(
            "background-color: #d7e3f4"
        ):
            ui.label("LEFT DRAWER")
        with ui.right_drawer(fixed=False).style("background-color: #ebf1fa").props(
            "bordered"
        ) as right_drawer:
            ui.label("RIGHT DRAWER")
        with ui.footer().style("background-color: #3874c8"):
            ui.label("FOOTER")
